// source --> http://grodnotv.by/wp-content/plugins/simple-download-monitor/js/sdm_wp_scripts.js?ver=5.2.3 // Simple Download Monitor frontend scripts function sdm_is_ie() { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { return true; } return false; } jQuery(document).ready(function ($) { // Populate all nested titles and links $('li.sdm_cat').each(function () { var $this = $(this); this_slug = $this.attr('id'); this_id = $this.children('.sdm_cat_title').attr('id'); // Run ajax $.post( sdm_ajax_script.ajaxurl, { action: 'sdm_pop_cats', cat_slug: this_slug, parent_id: this_id }, function (response) { // Loop array returned from ajax function $.each(response.final_array, function (key, value) { // Populate each matched post title and permalink $this.children('.sdm_placeholder').append('' + value['title'] + ''); }); $this.children('span').append(''); } ); }); // Hide results on page load $('li.sdm_cat').children('.sdm_placeholder').hide(); // Slide toggle for each list item $('body').on('click', '.sdm_cat_title', function (e) { // If there is any html.. then we have more elements if ($(this).next().html() != '') { $(this).next().slideToggle(); // toggle div titles } }); // Download buttons with terms or captcha has this class applied to it $('.sdm_download_with_condition').on('click', function (e) { e.preventDefault(); $(this).closest('form').trigger('submit'); }); // Check if terms checkbox is enabled. if ($('.sdm-termscond-checkbox').length) { $.each($('.sdm-termscond-checkbox'), function () { if (!$(this).is(':checked')) { var cur = $(this).children(':checkbox'); var btn = $(cur).closest('form').find('a.sdm_download,a.sdm_download_with_condition'); $(btn).addClass('sdm_disabled_button'); } }); $.each($('.sdm-download-form'), function () { var form = $(this); form.on('submit', function () { if ($('.agree_termscond', form).is(':checked')) { $('.sdm-termscond-checkbox', form).removeClass('sdm_general_error_msg'); return true; } else { $('.sdm-termscond-checkbox', form).addClass('sdm_general_error_msg'); } return false; }); }); $.each($('.agree_termscond'), function () { var element = $(this); var form = element.closest('form'); element.on('click', function () { if (element.is(':checked')) { $('.sdm_download_with_condition', form).removeClass('sdm_disabled_button'); $('.sdm-termscond-checkbox', form).removeClass('sdm_general_error_msg'); } else { $('.sdm_download_with_condition', form).addClass('sdm_disabled_button'); $('.sdm-termscond-checkbox', form).addClass('sdm_general_error_msg'); } }); }); } }); // source --> http://grodnotv.by/wp-content/plugins/sticky-menu-or-anything-on-scroll/assets/js/jq-sticky-anything.min.js?ver=2.1.1 /** * @preserve Sticky Anything 2.1.1 | @senff | GPL2 Licensed */ var stickyAnythingBreakpoint = '' // solely to use as a debugging breakpoint, if needed. !function(e){function t(t,i,n,s,l,o,r,d){$listenerElement=e(".sticky-element-active");var c=$listenerElement.offset();if(orgElementTop=c.top,l){var a=e(l).offset();pushElementTop=a.top}var m=window,g="inner";if("innerWidth"in window||(g="client",m=document.documentElement||document.body),viewport=m[g+"Width"],o&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0,e(window).scrollTop()>=orgElementTop-t-adminBarHeight&&viewport>=i&&viewport<=n){coordsOrgElement=$listenerElement.offset(),leftOrgElement=coordsOrgElement.left,widthPlaceholder=$listenerElement[0].getBoundingClientRect().width,widthPlaceholder||(widthPlaceholder=$listenerElement.css("width")),heightPlaceholder=$listenerElement[0].getBoundingClientRect().height,heightPlaceholder||(heightPlaceholder=$listenerElement.css("height")),widthSticky=e(".sticky-element-original").css("width"),"0px"==widthSticky&&(widthSticky=e(".sticky-element-original")[0].getBoundingClientRect().width),heightSticky=e(".sticky-element-original").height(),paddingOrgElement=[e(".sticky-element-original").css("padding-top"),e(".sticky-element-original").css("padding-right"),e(".sticky-element-original").css("padding-bottom"),e(".sticky-element-original").css("padding-left")],paddingSticky=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],marginOrgElement=[$listenerElement.css("margin-top"),$listenerElement.css("margin-right"),$listenerElement.css("margin-bottom"),$listenerElement.css("margin-left")],marginPlaceholder=marginOrgElement[0]+" "+marginOrgElement[1]+" "+marginOrgElement[2]+" "+marginOrgElement[3],assignedStyles="";for(var h in r)"inline"==r[h]?assignedStyles+=h+":inline-block; ":assignedStyles+=h+":"+r[h]+"; ";elementHeight=0,heightPlaceholder<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),l&&e(window).scrollTop()>pushElementTop-t-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-t-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,assignedStyles+="width:"+widthPlaceholder+"px; height:"+heightPlaceholder+"px; margin:"+marginPlaceholder+";",e(".sticky-element-original").removeClass("sticky-element-active").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("position","fixed").css("left",leftOrgElement+"px").css("top",t+"px").css("width",widthSticky).css("margin-left",0).css("padding",paddingSticky).css("margin-top",stickyTopMargin).css("z-index",s),e(".sticky-element-placeholder").hasClass("sticky-element-active")||e(".sticky-element-placeholder").addClass("sticky-element-active").attr("style",assignedStyles)}else e(".sticky-element-original").addClass("sticky-element-active").removeClass("element-is-sticky").addClass("element-is-not-sticky").attr("style",d),e(".sticky-element-placeholder").hasClass("sticky-element-active")&&e(".sticky-element-placeholder").removeClass("sticky-element-active").removeAttr("style").css("width","0").css("height","0").css("margin","0").css("padding","0")}function i(){e(".sticky-element-original").addClass("sticky-element-active").before('')}function n(e){return o={},o.display=e.css("display"),o.float=e.css("float"),o.flex=e.css("flex"),o["box-sizing"]=e.css("box-sizing"),o.clear=e.css("clear"),o.overflow=e.css("overflow"),o.transform=e.css("transform"),o}function s(t,i,n,s,o,r,d){var c=e(".sticky-element-original").offset();if(orgElementTop=c.top,o){var a=e(o).offset();pushElementTop=a.top}var m=window,g="inner";"innerWidth"in window||(g="client",m=document.documentElement||document.body),viewport=m[g+"Width"],d&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0,e(window).scrollTop()>=orgElementTop-t-adminBarHeight&&viewport>=i&&viewport<=n?(orgElement=e(".sticky-element-original"),coordsOrgElement=orgElement.offset(),leftOrgElement=coordsOrgElement.left,widthOrgElement=orgElement[0].getBoundingClientRect().width,widthOrgElement||(widthOrgElement=orgElement.css("width")),heightOrgElement=orgElement.outerHeight(),paddingOrgElement=[orgElement.css("padding-top"),orgElement.css("padding-right"),orgElement.css("padding-bottom"),orgElement.css("padding-left")],paddingCloned=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],1==r&&e(".sticky-element-cloned").length<1&&l(t,s),elementHeight=0,heightOrgElement<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),o&&e(window).scrollTop()>pushElementTop-t-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-t-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,e(".sticky-element-cloned").css("left",leftOrgElement+"px").css("top",t+"px").css("width",widthOrgElement).css("margin-top",stickyTopMargin).css("padding",paddingCloned).show(),e(".sticky-element-original").css("visibility","hidden")):(1==r?e(".sticky-element-cloned").remove():e(".sticky-element-cloned").hide(),e(".sticky-element-original").css("visibility","visible"))}function l(t,i){e(".sticky-element-original").clone().insertAfter(e(".sticky-element-original")).addClass("sticky-element-cloned").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("position","fixed").css("top",t+"px").css("margin-left","0").css("z-index",i).removeClass("sticky-element-original").hide()}e.fn.stickThis=function(o){var r=e.extend({top:0,minscreenwidth:0,maxscreenwidth:99999,zindex:1,legacymode:!1,dynamicmode:!1,debugmode:!1,pushup:"",adminbar:!1},o),d=e(this).length,c=e(r.pushup).length;return c<1?(1==r.debugmode&&r.pushup&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the Push-up element ("'+r.pushup+'").'),r.pushup=""):c>1&&(1==r.debugmode&&console.error("STICKY ANYTHING DEBUG: There are "+c+' elements on the page with the selector/class/ID you selected for the push-up element ("'+r.pushup+'"). You can select only ONE element to push the sticky element up.'),r.pushup=""),d<1?1==r.debugmode&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'").'):d>1?1==r.debugmode&&console.error("STICKY ANYTHING DEBUG: There There are "+c+' elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'"). You can only make ONE element sticky.'):1==r.legacymode?(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),1!=r.dynamicmode&&l(r.top,r.zindex,r.adminbar),checkElement=setInterval(function(){s(r.top,r.minscreenwidth,r.maxscreenwidth,r.zindex,r.pushup,r.dynamicmode,r.adminbar)},10)):(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),orgAssignedStyles=n(e(this)),orgInlineStyles=e(".sticky-element-original").attr("style"),null==orgInlineStyles&&(orgInlineStyles=""),i(),checkElement=setInterval(function(){t(r.top,r.minscreenwidth,r.maxscreenwidth,r.zindex,r.pushup,r.adminbar,orgAssignedStyles,orgInlineStyles)},10)),this}}(jQuery);